#include<bits/stdc++.h>
using namespace std;
#define int long long
struct mapp {
	int x, i;
};
bool cmp(mapp m1, mapp m2)
{
	return m1.x < m2.x;
}
signed main()
{
	int n, m;
	cin >> n >> m;
	mapp a[n + 1];
	for (int i = 1; i <= n; i++) {
		cin >> a[i].x;
		a[i].i = i;
	}
	for (int i = 1; i <= n; i++) {
		a[i].x = i + (a[i].x * m) ;
	}
	sort(a + 1, a + n + 1, cmp);
	for (int i = 1; i <= n; i++) {
		cout << a[i].i << " ";
	}
	return 0;
}
